package com.ss.android.article.common.share.factory;

import android.content.Context;

import com.ss.android.article.common.share.helper.CommonCopylinkHelper;
import com.ss.android.article.common.share.helper.CommonHtmlShareHelper;
import com.ss.android.article.common.share.helper.CommonQQShareHelper;
import com.ss.android.article.common.share.helper.CommonQZoneShareHelper;
import com.ss.android.article.common.share.helper.CommonSystemShareHelper;
import com.ss.android.article.common.share.helper.CommonWXShareHelper;
import com.ss.android.article.common.share.interf.IActionHelper;
import com.ss.android.article.common.share.interf.IShareDataHook;
import com.ss.android.article.share.entity.ShareAction;

public class ShareHelperFactory {
    private static ShareHelperFactory instance;

    public ShareHelperFactory() {

    }

    public static ShareHelperFactory getInstance() {
        if(instance == null) {
            Class v1 = ShareHelperFactory.class;
            synchronized (v1){
                if(instance == null) {
                    instance = new ShareHelperFactory();
                }
            }
        }

        return instance;
    }

    public static IActionHelper getActionHelper(Context context, ShareAction shareAction, IShareDataHook shareDataHook) {
        IActionHelper v0 = null;
        switch(shareAction.getItemId()) {
            case 1: {
                v0 = CommonWXShareHelper.getInstance(context, shareDataHook, 1);
                break;
            }
            case 2: {
                v0 = CommonWXShareHelper.getInstance(context, shareDataHook, 0);
                break;
            }
            case 3: {
                v0 = new CommonQQShareHelper(context);
                break;
            }
            case 4: {
                v0 = new CommonQZoneShareHelper(context);
                break;
            }
            case 10: {
                v0 = new CommonSystemShareHelper(context);
                break;
            }
            case 11: {
                v0 = new CommonHtmlShareHelper(context);
                break;
            }
            case 17: {
                v0 = new CommonCopylinkHelper(context);
                break;
            }
        }

        return v0;
    }
}

